package com.sec.moveFile.document.domain;


import org.hibernate.annotations.Formula;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author 01000115
 */
@Entity
@Table(name = "SRM_SYS_DOC")
public class SystemDocumentDO extends AbstractAuditingEntity {

    private static final long serialVersionUID = -8738621571881679556L;
    @Column(name = "REF_ID", columnDefinition = "varchar(32) DEFAULT NULL COMMENT 'Reference id'")
    private String refId;

    @Column(name = "DOC_MODULE", columnDefinition = "varchar(32) DEFAULT NULL COMMENT 'DOC_MODULE'")
    private String module;

    @Column(name = "DOC_NAME", columnDefinition = "varchar(100) DEFAULT NULL COMMENT 'File name'")
    private String name;

    @Column(name = "DOC_DESC", columnDefinition = "varchar(255) DEFAULT NULL COMMENT 'File description'")
    private String description;

    @Column(name = "DOC_EXTENTION", columnDefinition = "varchar(50) DEFAULT NULL COMMENT 'File extension name'")
    private String extension;

    @Column(name = "DOC_URL", columnDefinition = "varchar(200) DEFAULT NULL COMMENT 'File url'")
    private String url;

    @Column(name = "DOC_CATE", columnDefinition = "varchar(50) DEFAULT NULL COMMENT 'File cate'")
    private String cate;

    /**
     * 0:附件，1：文件
     */
    @Column(name = "MAIN_FLAG", columnDefinition = "char(1) DEFAULT NULL COMMENT '主文件标志位(动态字段文件型)'")
    private String mainFlag = "0";

    @Formula("(select m.move_flag from srm_sys_doc_move m where m.doc_id = id)")
    private String moveFlag;

    @Formula("(select m.check_flag from srm_sys_doc_move m where m.doc_id = id)")
    private String checkFlag;

    public String getMoveFlag() {
        return moveFlag;
    }

    public void setMoveFlag(String moveFlag) {
        this.moveFlag = moveFlag;
    }

    public String getRefId() {
        return refId;
    }

    public void setRefId(String refId) {
        this.refId = refId;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMainFlag() {
        return mainFlag;
    }

    public void setMainFlag(String mainFlag) {
        this.mainFlag = mainFlag;
    }

    public String getCate() {
        return cate;
    }

    public void setCate(String cate) {
        this.cate = cate;
    }

    public String getCheckFlag() {
        return checkFlag;
    }

    public void setCheckFlag(String checkFlag) {
        this.checkFlag = checkFlag;
    }
}
